package com.es.vo;

import co.elastic.clients.elasticsearch._types.mapping.Property;
import co.elastic.clients.elasticsearch.indices.Alias;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;

/**
 *
 * @author heyonghao
 * @date 2023/2/3
 */
@Data
public class EsRestIndexVo implements Serializable {

    /**
     * 索引名称
     */
    private String name;
    /**
     * 索引别名
     */
    private String aliases;
    /**
     * 索引别名-配置
     */
    private Alias aliasSetting;
    /**
     * 分片-对应副本数量
     */
    private String numberOfReplicas;
    /**
     * 分片数量
     */
    private String numberOfShards;
    /**
     * 索引属性字段map
     */
    private Map<String, Property> property;

    public String getNumberOfReplicas() {
        if (numberOfReplicas==null){
            return "1";
        }
        return numberOfReplicas;
    }

    public String getNumberOfShards() {
        if (numberOfShards==null){
            return "1";
        }
        return numberOfShards;
    }
}
